Updated to new binary format

Detect if the ring wraps and sort the packets correctly.