two new functions that work with matrix