first attempt at multigen
slightly better concurrency patterns, but still ugly