implemented isCheckmate