added legend sorting example