Revert order of legend, keys