the begining of the match code for finding a match for one method