added getMatch function