return m*60000; //converts minutes to milliseconds
60000 is a literal. The compiler will assume that it is an int, since there are no directives to the contrary. m is an int. You will have a very hard time holding the result of multiplying an int by an int in an int register, when one of the values overflows the int register by itself. The only value for m that will not result in an overflow is 0.
Make the compiler understand that 60000 is an unsigned long by using UL as the suffix.
Do the same thing with any other literals that could possibly result in overflow, especially where the result is going to be stored in a non-int type.
With the functions working properly, the rest of your code should work, too. What (else) is the problem?