finish extract_bits