corrected code semantics