Removed some globals, and improved the queries to wipe the blankspot column