added padding function