added syntax trees, lots of cleanups