padding functions properly