printing iteration in between