create a function that does the same action as join