Fixing the code