changed lists to trees