Added some comments and modified the structure of the packets for easier maintenance