use a for each to do matches