Add the packet counting code