Fixed the bugs around neighbour cells logic