Added a switch statement in navigate() to handle the current flight state and added functions to implement turning to a heading.