This is wicked! I am trying to get it to work and am frantically fixing tabs and spaces... but isn't line 50: self._all_states |= set(key[i] for key in probabilities) an error? isn't it supposed to be: self._all_states != set(key[i] for key in probabilities)