I made fold and surrogateFold seperate, because it seemed to be causing too many problems with the database. I also changed addChild() to account for the lack of side-effects.