WindowListener added, some main gui work