REVISED class Matrix