Counter reimplementation