adding if and while