Fixed calcIndex and began reworking calcAdjacencies