updated counting.c