Adapt methods rightPad and leftPad