put the code in the same while loop. easy as that.