added copy constructor to matrix