Updated Logistic regression code