input is now stored in a tree