Change while's to if's