replaced trees with lists