vertically aligns on resize and decrease number of global variables