Adjusted code to fix errors.