Change from Loop to While