add documentation about sorting, change the argument name from sorting to sorted