alignMiddle method added