better legend sort