is there a way to pause a while loop and display a message on each iteration?