fixed a bug with inverse of 2d matricies