whileLoop added