only generate parts of packet we actually use.  code could use some cleanup