Faster way to compute matches cover