Updated neighbour function