Added while loop
Added while loop