Updated output data structure (reduced memory consumption by 20%). Made event creation fixes. Updated tests.