working on logistic encoder