added matrix.py and outputmod.py