Added the code that allows backtracking of events and building the event tree