fixed bug in value-of-match (still need to write test case)