tag indexing based using graph, breaking up code