got rid of perl dependency for counter