walking through logistic regression code