Replaced tree with a list -- there was some mistake in the tree and I could not find it. A list should suffice and is simpler.