Changed the join logic, much easier to read & understand.