Adding logistic regression function