improved flight logic