Mac_Lin Two-step optimization, first opt finished with bugs