Create the window

The lines to create the window.
Added error on error (lol)