Added sort feature to index. Tests passing.