Update matrix.py