cleaned up some very unOO code and fixed bug where dragging off the screen causes an event to not become unselected