let's go through the arrays fewer times