Modified indexing mechanism and included more tests