Added file to matrix method