added thompson sampling, but it may have some bugs.