Fixed calcIndex and began reworking calcAdjacencies plus added comments