Correctness Invariant (python) - fixed