started _ds_to_matrix
fixed merge