root node is the last node; demo program