added legend, additional sort options