adding logreg to code but not done yet