if statement and loops