if-else structure modified