implementing store and load