Fully working logistic regression