changed < maxReps+1 to simply <= maxReps