Added while loop.