generator to conversion to binary tree works