fixed typo in innerRrangeMax in inner for loop in increment counter.