Added option to enter the submessage size in decode function.