Moved create new window into separate function
Added basic implementation for new windows opening