The science of fighting a fire