use two counters and bases