amend sorting