modified gradientDescent.m