Corrected code