Added inversion and matrix code
Continued work on matrix support