Added if-then-else