added a window class.
made few changes. added an event class.