Solved, did all the math with millis() and used long for times since the numbers were too big. Thanks guys.