added string re-assembly code