use iteration in diff example