Use interators instead of counters for loops.