Added more constants, changed some names, and embedded the packet length in the packet.