Correctness verified.