this mostly works (should we make those time functions another module?)