completed the save and list functions