Corrected secondSolution() to overcome an issue where VM allocates only 32 bits for a long type variable

I had to take two long variables, cause for some wierd reason my VM on a
64 bit machine is only allocating 32 bits for a long type variable.