added $resulthash argument to truthtable()