Wrote more structure for the packet handling