Changed some while loops to for statements