Changed the calculation of steepest descent algorithm