renamed Enum.product into Enum.cartesian_product
additional state in the state machine (deal with termination)