implemented two-param gradient descent in R