de-globalized first_packet
added state initialization routine