recording and sorting and displaying events