Finish the padding function.