added bandit code