todict() method added to class condition