implented a hacky but working version of save and load