Added additional printing guard.
Refactored event finding into function and added timing code.
Fixed pileup generation off by one error