added code to generate expressions for each row of truth table