Improved collapsing function in functions.R