add example of using per-iteration callback