LU decomposition related code