Change to use final time instead of number of time steps.