action algorithm