Optimized CheckContradictions and still passes test