cleaned up the main patch