added universal save and load functions