adjusting start and end time of sample