Converted beachline to a tree-like structure.