Indexing code complete. Working for handcrafted testcases.