Your suggestion works for the most part except when there is a single self atoms ```array('.')```

I have instead wrapped the code in sprintf rather than a simple string concat