Added action chooser alorythm