Implemented V3 of the packet format and added switch to go between V2 and V3