how to write findMatch