Optim/get best move

There are some bugs not detected by the tests.