Added while loop