Correcting the code