Minor changes in sort.
Documentation updated.