first implementation of NewFit