added a save method