Added sorting method