added a match function