sample: write one file per algo
closure: Use dynamic instead of static count of iterations