create the get_matches function