Add functionality to automatically determine filename.