Code to generate Ties matches