- buildTree now allocates one array that contains all the nodes. This is
  much faster