initial draft of aggregation scripts, exported from notebook