added functionality to join files