tighten typing of getNeighbours