convert from matrix to data frame for results