Moved the windows slashifying into its own function