using counter instead