Added function to calculate time till next disturbance