adding function max in u.lua, starting optim