changed int to long for event number, as int has too few bits