added code for if & if-else