Changed the table matchings function.