Add functions for logistic regression