Added while statements.