Rest of the events application code