reverse legend order