functions for: previous and next branching point, forward and backward chains