added information about how to deal with multiple events with pseudo code