Logistic fn implementation