Added sorting functions for display.