reading matrix files