Changed the matrix class

Matrix class now stores data as a 2D vector