Modified logistic regression module according to comments