removing unused counter variable