implementing loggistic regression