added logistic regression function