Added func to set sequence number
fixed var size fields to byte array
Proper SM length set for submit_sm