implement fly function