added support for nand and nor