Logistic regression looks good. Refactor needed badly though.