maxValue to maxValuetemp