Update to write out distribution to a file.