trimatch.apply2 function

Recursive function to find possible matched triplets using the apply functions.