Move padding out of the for() loop to avoid unnecessary calculation.