Change while loop to .times