added a window class, reworked input