Changed patch system and added PatchGenerator