Adjustments to new encode_datalist