implement concatenation function and add test