Why did John Gorrie invent the air cooling machine?

To cool down trains
To keep food cold
To make animals more comfortable
To treat patients with fevers