Counter redesign: user-defined stacks for counting