finished the steepest function