Rename some variables and re-implement collect().