added tests and refactored the show page for events, average calculation is now in the events class