Improved memory usage

generate one event array per factor loop instead of saving factor event arrays