Finally changed this so that it's a library, so I removed the run code at the bottom. Programs will now be able to call this library now that the pickle will work properly.