Building resilience to earthquakes