simplify by combining increment with array access