moved code around and added fly_middle function