Added matrix multiplication and inversion.