addes a save file algorithm