Cleaned up the code in simple flight script