added readMatrix function
test