Added saving and loading functionality. Not yet tested!