Checkpoint: working version, requires unique filename.