replaced struct.pack() with bytes()