Fixed the problem with getting wrong bestMove

The problem lied in that the bestMove werent used correctly. i.e. it never checked if the value of a move were better than the previous and that it always chose the last possible move.