refactored and changed logic to both Join samples