with more than one object it also works, as you suggested before, one function for each object, volume1(), volume2() and so on, and in the main return an array [volume1().csg, volume2().csg]. But people must be aware that in order to keep track of data it is better to have a little more complex main function like that :
function main(){
let V1 = volume1(), V2 = volume2();
// it is now possible to use data like V1.groups
return [V1.csg, V2.csg];
}
function main(){
let V1 = volume1(), V2 = volume2();
// it is now possible to use data like V1.groups
return [V1.csg, V2.csg];
}