added waitforstart and wait time functions