Add while loop and conditional statements