updated prepare_states