Added the code block to implement simple UCB1 algorithm.
Improved early search termination code.
Removed unnecessary code block.
Modified to use known available directions.
Modified to use preserved state.