Added functionality for scanning the JOIN table and building the correct
combination of results