Incorporated Ingerid's code (and "unsigned long" insight about tracking time)