fix misuse of abs instead of fabs. Reorganization of the code to make it independent from the data/mc scale factor boundaries.