fixed bad index incrementor in each