Added some functionality to modifywindow