replace strjoin with manual string joining