finished changing vector class to matrix class