added matrix.py for composing sparse matrix