Basic things working, but going to switch to using a real tree library.