Basic matching/joining routine ready to be tested