set up infrastructure for list passing and emptying