use unsigned long C type for counters

so that we can deal with larger data sets