Update counter.c

add more comments