Collapse (my version of inject) is down to 9 lines.