code reorganization
add the implementation of allCollect using a broadcast variable