Added some more tree checks and broke up the graph database