Simplified a lot of stuff. Still blocked on proper tree stuff.