starting to migrate to logit func
completed