Wrote constructor to generate matrix based on a file