cleaning, changed for back to while