Rewritten get matches and added search for matches