FOR SOME REASON TOTALPACKETS ONLY WORKS WHEN GLOBAL VARIABLE
have to start differentiating circuits and algorithms