Worked out most of the neighbour selection logic. Currently the clone method is sometimes inserting null child nodes, which is weird.