Fixed some units, sorted codes
Added legend
Added sorting of codes and datasets