Now the duration of events is variable. Still need some testing