more accurate nextLevel.
first crack at maxFun