added some comments and fixed an issue that was preventing filtering by event type