Finished the logistic regression algo