Declaring some working variables as long int instead of int