changed input format and key data type from 'int' to 'long int'