add number_of_parents number_of_states function and modified get_cpd