Added functions for finding cyclic multipaths and other auxiliary functions for determining size-change termination.