Setting up patch procedure

includes first untested patch by vlad zaritsky