optimizer returns correct results now! hopefully