Added condition for logical and. It doesnt remove the dead if else code yet.