Added option to supply matrix file