Why housing shortages cause homelessness