Added padding function to correct display issues