Changed code so that it creates as few data1 nodes as possible.