adding updated logistic regression code