workign on mat.py