added a good chunk of saving/loading functionality