termination and invariants 9368833