First draft of code for generating matches