fixing k-armed bandit algorithms