Errors in code corrected