used int instead of long for count