works for if, doing while