Added sorting of removed nodes