Fixing issues with errors in my code