Chnaged in while loop for more readability