Improved patch function

The program is now accepting more patch commands in one diff file.