fix bug in maxThree