implement if then else