optimizer working, pre-cleanup