code stabs for counting implementation