diff --git a/indexation.cabal b/indexation.cabal
--- a/indexation.cabal
+++ b/indexation.cabal
@@ -1,5 +1,5 @@
 name: indexation
-version: 0.4.7
+version: 0.4.8
 category: Data
 synopsis: Tools for entity indexation
 description: A set of tools for indexing entities
@@ -35,10 +35,11 @@
     Indexation.Functions
     Indexation.FoldM.Basic
     Indexation.Utils.Vector
-    Indexation.Utils.UnboxedVector
+    Indexation.Utils.BitVector
     Indexation.Utils.Unfoldr
   build-depends:
     base >=4.11 && <5,
+    bitvec >=0.1.0.2 && <0.2,
     bytestring >=0.10.8 && <0.11,
     cereal >=0.5.5 && <0.6,
     cereal-vector >=0.2.0.1 && <0.3,
@@ -49,7 +50,7 @@
     hashable >=1 && <2,
     list-t >=1 && <1.1,
     mmorph >=1 && <2,
-    potoki >=2 && <2.1,
+    potoki >=2.0.15 && <2.1,
     potoki-cereal >=0.3 && <0.4,
     profunctors >=5.2 && <6,
     stm-containers >=1.1 && <1.2,
diff --git a/library/Indexation/Functions.hs b/library/Indexation/Functions.hs
--- a/library/Indexation/Functions.hs
+++ b/library/Indexation/Functions.hs
@@ -3,13 +3,14 @@
 
 import Indexation.Prelude
 import Indexation.Types
-import Indexation.Instances ()
 import qualified Data.Vector as Vector
 import qualified Data.HashMap.Strict as HashMap
 import qualified Data.Vector.Unboxed as UnboxedVector
 import qualified Data.Vector.Unboxed.Mutable as MutableUnboxedVector
 import qualified Data.Vector.Algorithms.Intro as IntroVectorAlgorithm
-import qualified Indexation.Utils.UnboxedVector as UnboxedVector
+import qualified Data.Bit as Bit
+import qualified Data.Vector.Unboxed.Bit as BitVec
+import qualified Indexation.Utils.BitVector as UnboxedVector
 import qualified Indexation.Utils.Unfoldr as Unfoldr
 
 
@@ -26,10 +27,10 @@
   IndexSet (UnboxedVector.filledIndicesFoldable size (Unfoldr.hashMapValuesByKeys entities map))
 
 lookupInIndexSet :: Index entity -> IndexSet entity -> Bool
-lookupInIndexSet (Index indexInt) (IndexSet vec) = vec UnboxedVector.!? indexInt & fromMaybe False
+lookupInIndexSet (Index indexInt) (IndexSet vec) = vec UnboxedVector.!? indexInt & maybe False Bit.toBool
 
 mergeIndexSets :: IndexSet entity -> IndexSet entity -> IndexSet entity
-mergeIndexSets (IndexSet vec1) (IndexSet vec2) = IndexSet $ UnboxedVector.zipWith (||) vec1 vec2
+mergeIndexSets (IndexSet a) (IndexSet b) = IndexSet (BitVec.intersection a b)
 
 topCountedIndexSet :: Int -> IndexCounts a -> IndexSet a
 topCountedIndexSet amount (IndexCounts countVec) = let
@@ -41,8 +42,8 @@
     indexSetMVec <- MutableUnboxedVector.new countVecLength
     forM_ [0..(pred limitedAmount)] $ \ pairIndex -> do
       (_, index) <- MutableUnboxedVector.unsafeRead pairMVec pairIndex
-      MutableUnboxedVector.write indexSetMVec index True
+      MutableUnboxedVector.write indexSetMVec index (Bit.fromBool True)
     IndexSet <$> UnboxedVector.unsafeFreeze indexSetMVec
 
 indexSetByMinCount :: Word32 -> IndexCounts a -> IndexSet a
-indexSetByMinCount min (IndexCounts countVec) = IndexSet (UnboxedVector.map (>= min) countVec)
+indexSetByMinCount min (IndexCounts countVec) = IndexSet (UnboxedVector.map (Bit.fromBool . (>= min)) countVec)
diff --git a/library/Indexation/Instances.hs b/library/Indexation/Instances.hs
--- a/library/Indexation/Instances.hs
+++ b/library/Indexation/Instances.hs
@@ -4,7 +4,8 @@
 import Indexation.Prelude
 import Indexation.Types
 import Indexation.Instances.Cereal ()
-import qualified Data.Vector.Unboxed as UnboxedVector
+import Indexation.Functions
+import qualified Data.Vector.Unboxed.Bit as BitVec
 
 
 instance Show (Index a) where show (Index int) = show int
@@ -13,4 +14,4 @@
 deriving instance Hashable (Index a)
 
 instance Show (IndexSet a) where
-  show = show . UnboxedVector.ifoldr (\ i -> bool id (i :)) [] . (\ (IndexSet x) -> x)
+  show = show . BitVec.listBits . (\ (IndexSet x) -> x)
diff --git a/library/Indexation/Instances/Cereal.hs b/library/Indexation/Instances/Cereal.hs
--- a/library/Indexation/Instances/Cereal.hs
+++ b/library/Indexation/Instances/Cereal.hs
@@ -7,6 +7,7 @@
 import qualified Indexation.Cereal.Get as Get
 import qualified Indexation.Cereal.Put as Put
 import qualified Indexation.Constructors.EntityTable as EntityTable
+import qualified Data.Bit as Bit
 
 
 instance Serialize (Index a) where
@@ -22,7 +23,7 @@
   put = Put.putEntityTable put . EntityTable.indexTable
 
 instance Serialize (IndexSet a) where
-  get = IndexSet <$> Get.getVector get
-  put (IndexSet vector) = Put.putVector put vector
+  get = IndexSet <$> Get.getVector (Bit.fromBool <$> get)
+  put (IndexSet vector) = Put.putVector (put . Bit.toBool) vector
 
 deriving instance Serialize (IndexCounts a)
diff --git a/library/Indexation/Potoki/Produce.hs b/library/Indexation/Potoki/Produce.hs
--- a/library/Indexation/Potoki/Produce.hs
+++ b/library/Indexation/Potoki/Produce.hs
@@ -1,11 +1,28 @@
 module Indexation.Potoki.Produce
 (
   entities,
-) where
+  counts,
+  indexedCounts,
+)
+where
 
 import Indexation.Prelude
 import Indexation.Types
 import qualified Potoki.Produce as Produce
+import qualified Data.Vector.Generic as GenericVector
 
+
 entities :: EntityTable a -> Produce a
 entities (EntityTable vector) = Produce.vector vector
+
+{-|
+Counts in the index-order.
+-}
+counts :: IndexCounts a -> Produce Word32
+counts (IndexCounts vector) = Produce.vector vector
+
+{-|
+Counts in the index-order paired with their indices.
+-}
+indexedCounts :: IndexCounts a -> Produce (Int, Word32)
+indexedCounts (IndexCounts vector) = Produce.vectorWithIndices vector
diff --git a/library/Indexation/Predicate.hs b/library/Indexation/Predicate.hs
--- a/library/Indexation/Predicate.hs
+++ b/library/Indexation/Predicate.hs
@@ -5,7 +5,7 @@
 import Indexation.Types
 import Indexation.Instances ()
 import qualified Indexation.Prelude as Prelude
-import qualified Indexation.Utils.UnboxedVector as UnboxedVector
+import qualified Indexation.Utils.BitVector as UnboxedVector
 import qualified Indexation.Functions as Functions
 
 
diff --git a/library/Indexation/Prelude.hs b/library/Indexation/Prelude.hs
--- a/library/Indexation/Prelude.hs
+++ b/library/Indexation/Prelude.hs
@@ -1,6 +1,8 @@
 module Indexation.Prelude
 (
   module Exports,
+  UnboxedVector,
+  BitVector,
 )
 where
 
@@ -136,3 +138,17 @@
 -- list-t
 -------------------------
 import ListT as Exports (ListT(..))
+
+-- bitvec
+-------------------------
+import Data.Bit as Exports (Bit)
+
+-- 
+-------------------------
+import qualified Data.Vector.Unboxed.Bit as BitVec
+import qualified Data.Vector.Unboxed as UnboxedVector
+
+
+type UnboxedVector = UnboxedVector.Vector
+
+type BitVector = UnboxedVector Bit
diff --git a/library/Indexation/Types.hs b/library/Indexation/Types.hs
--- a/library/Indexation/Types.hs
+++ b/library/Indexation/Types.hs
@@ -4,6 +4,7 @@
 import Indexation.Prelude
 import qualified StmContainers.Map as StmMap
 import qualified Data.Vector.Unboxed as UnboxedVector
+import qualified Data.Vector.Unboxed.Bit as BitVec
 
 
 data Indexer entity = Indexer {-# UNPACK #-} !(TVar Int) {-# UNPACK #-} !(StmMap.Map entity Int)
@@ -18,6 +19,6 @@
 Set of indices.
 A more efficient alternative to @HashSet (Index entity)@.
 -}
-newtype IndexSet entity = IndexSet (UnboxedVector.Vector Bool)
+newtype IndexSet entity = IndexSet (BitVec.Vector BitVec.Bit)
 
 newtype IndexCounts entity = IndexCounts (UnboxedVector.Vector Word32)
diff --git a/library/Indexation/Utils/BitVector.hs b/library/Indexation/Utils/BitVector.hs
new file mode 100644
--- /dev/null
+++ b/library/Indexation/Utils/BitVector.hs
@@ -0,0 +1,15 @@
+module Indexation.Utils.BitVector
+where
+
+import Indexation.Prelude hiding (Vector)
+import Data.Vector.Unboxed hiding (forM_)
+import qualified Data.Vector.Unboxed.Mutable as MutableUnboxedVector
+import qualified Data.Bit as Bit
+
+
+filledIndicesFoldable :: Foldable foldable => Int -> foldable Int -> Vector Bit
+filledIndicesFoldable size foldable = runST $ do
+  mv <- MutableUnboxedVector.new size
+  forM_ foldable $ \ index -> do
+    MutableUnboxedVector.unsafeWrite mv index (Bit.fromBool True)
+  unsafeFreeze mv
diff --git a/library/Indexation/Utils/UnboxedVector.hs b/library/Indexation/Utils/UnboxedVector.hs
deleted file mode 100644
--- a/library/Indexation/Utils/UnboxedVector.hs
+++ /dev/null
@@ -1,14 +0,0 @@
-module Indexation.Utils.UnboxedVector
-where
-
-import Indexation.Prelude hiding (Vector)
-import Data.Vector.Unboxed hiding (forM_)
-import qualified Data.Vector.Unboxed.Mutable as MutableUnboxedVector
-
-
-filledIndicesFoldable :: Foldable foldable => Int -> foldable Int -> Vector Bool
-filledIndicesFoldable size foldable = runST $ do
-  mv <- MutableUnboxedVector.new size
-  forM_ foldable $ \ index -> do
-    MutableUnboxedVector.unsafeWrite mv index True
-  unsafeFreeze mv
diff --git a/library/Indexation/Utils/Unfoldr.hs b/library/Indexation/Utils/Unfoldr.hs
--- a/library/Indexation/Utils/Unfoldr.hs
+++ b/library/Indexation/Utils/Unfoldr.hs
@@ -2,10 +2,9 @@
 where
 
 import Indexation.Prelude
-import Indexation.Types
-import Indexation.Instances
 import DeferredFolds.Unfoldr
 import qualified Data.HashMap.Strict as HashMap
+import qualified Data.Vector.Unboxed.Bit as BitVec
 
 
 hashMapAt :: (Hashable a, Eq a) => a -> HashMap a b -> Unfoldr b
@@ -15,3 +14,8 @@
 hashMapValuesByKeys keys hashMap = do
   key <- foldable keys
   hashMapAt key hashMap
+
+bitVecWords :: BitVector -> Unfoldr Word
+bitVecWords vec = do
+  index <- intsInRange 0 (pred (BitVec.wordLength vec))
+  return (BitVec.indexWord vec index)
