changed back to if then else style