change matching to a series loop