improved runtime performance of badmatchtable