Changed the uint16_t time variables to uint32_t. For use with millis()