added function from Sergei to swap two windows and to change horizantal separation with vertical