Completed Homework 1 univariate gradient descent