Allow direction to be "in" or "out" when using getNeighbours().