Function endVertical