Updated algorithm for plane flying