Improved reading of matrix