completed the logit method