put the logic for choosing next state based on the choice.value here