refactored to make topic a long, storing two ints, the current topic and the prior topic. This allows to compute deltas without the object creation/gc overhead of using a tuple