Took out line 75 as it's not needed. As for the global statement, it seems to only work where it is…