NeighborSet.cs ported