-- implemented a new approach to fit loss function using a set of linear lower bounds
   old implementation is still available via ifdefs