third version : solve order problem, but find a max value problem