legend on top of other elements; cleanup