Replaced literal home path with os.environ.
Keys are now deleted when they are checked, because they are single use.