moved start time calc down in script