fix pieces counting
implement endgame db