How the Supreme Court controlled the midterms