implement neighbour generation and rule on array, bugs in neighbour generator