data now converted to matrix (in case it is not )