Added sorting to the bar chart