fixed a few bugs in indexer, wrote test class for indexer, passes