adjusting the counter variable