Adding callback to display intermediate results