use unsigned long as counter