factored the vertical centering code into separate function, everything is now centered