midterms -- fixed legend bug