refactored chessbot works