added vectorized implementation of gradient descent for multiple variables that now will work for training maxtrices of any size