Changed toJSON/fromJSON to save/load and added the desired flag to the save method