move this together with the start time in a function