fixed if statement
add while statement