append buildCompactString function