added logit and invlogit functions