Implementing save file function.