detect cycles/non-monotonic cases
notes and debug