Everything works as expected. Still need to fix the tridiag function