Modified save file function to make it easier to use. All that for a debugging function !