Fingerprint filtering (i.e. superset testing of bitstrings) is a key step in the algorithm and crucial for performance. We perform fast fingerprint filtering by first sorting the library bitstrings into balanced binary trees. A balanced binary tree conceptually is a kd-tree generated on a set of bitstrings B = {b 1 , b 2 , .., b n }, b i ∈ B m . To generate a balanced binary tree, we recursively split the set of bitstrings B a by selecting a specific bit s that is balanced (i.e. occurs similarly often as 0 and 1 in B a ) into two roughly equal subsets