Updated code to work with the V3 packet format