match method changed to handle array of cards