commented modifications and added patch script