Changed addNeighbor(key) method