Added if and else statement