added code to make a top level window.