add trinary, func dec, but need more work