using int instead of long to store sum value