finished the REST operations on matrices