collapse functions implemented and tested
using composeDataFrame