replace 'n' with counter-increment