rename add_states to set_states and changed it to accept dictionaries