replaced jmaxsum with newest