Little bit of variable renaming to separate globals from locals