function trim(s) return s:match "^%s*(.-)%s*$" end