Logic Of An If Else Statement