Sorry for that, i am quite new to git.
Attaching patch with only important parts