finish the correctness proof