some deletes moved so that they are executed earlier
bug fix: for loop now uses event offset information
now releases memory properly
memory leak fixed
inclusive to exclusive psum