switched to binary-search-tree for indexing