somewhat old code using MLFit