sample coin counter impl