Added matrix file reading