maxFun done, writing main