adding code to allow multiple types for events and toggling of events by type