output min and max valve, change calculte sum in code

and not round the valve