calcIndex and testAdjacency JUnit test are now all passing