Add chooseAction algorithm