Finished optimizing the cut optimizer, some code cleanup left to do