first part of new event/input handling system