Added old code as skeleton for gradient descent and linesearch