fixed demo code etc, fixed head of packet bug