Added planned and unplanned events, refactored some of the logic for the tabs