Revamped the Window Class and a lot of bug fixes