Added readmatrix reference implementation