While Loop

Use while loop instead of if statement.