added the join function