Made vertical realigning based on window height instead of hard coded