First implementation of logistic regression