Corrected Errors in code