updated to tensor-var & declare-func system