updated main loop, added flight phase 4 to 5
transition code