change to add explicit length field and make compatible with