almost got the event handling system working