Modified to specify an end time