added first, last, counter to loops