redone the patch apply stuff