finally understanding packet lengths
fixed merge conflicts