Finished work in matrix.py