added sorting to list operations