Added some code to create a window