build tree almost finished