Logictree

Logictree done, merging into master.