Made helper functions and changed how time is stored