This idea relies on the fact that the packets are sequenstial as opposed to being recursive. To make it work I need to make the whole packet processing process a function and pass in the subpackets in