Line 27 syntax improvment by Danny
Fixed logical order that addPad() is called in.