Corrected errors and removed unused imports.