created a findmatch function and tested with some hard coded variables