Added sorting after passing