Added a time variable to set a time scale to the exponential decay.