Added matrix object and inversion function