Script improvements and addition of logistic regression code