resizes and reshapes elements