started work on the patch phase code