Fixed an issue that the fortran code had with large numbers by changing some integers to long int. Note that any number larger than e18 is to large for the code to work properly.