added calcAdjacencies and map to hold data