implemented concat-elements function