[1014923] Refactor sortedTree to sorted, adjusted docs and addressed feedback