dramatically simplifying indexing/searching code
rebuilt for testing
fixing bugs from refactoring