create root node correctly, pop root correctly