Adding functionality to save files