How to engineer buildings for fire safety