Adding logistic gradient descent alg.