reworked some stuff to become more state-independent and allow for multiple runs over the same tree... apparently, soemwhere a bug still lingers