Implement counter logic