changed if-then-else syntax