can we rename maxLength to ii (just to be consistant with other loops in our codebase)