make the right calculation of maximal value 2047