-my $hex = unpack('H*', $pos->bitpacked_fen);
-system("./binlookup", "./open.mtbl", $hex);
+my $bpfen_hex = unpack('H*', $pos->bitpacked_fen);
+my $prev_pos_hash_hex = unpack('H*', pack('S', $filter_prev_pos_hash));
+print $chld_in $bpfen_hex, "\n", $prev_pos_hash_hex, "\n";
+
+chomp (my $line = <$chld_out>); # Root position hash.
+print $line, "\n";
+
+chomp ($line = <$chld_out>); # Actual stats.
+print $line, "\n";
+my ($white, $draw, $black, $computer, $opening_num, $white_avg_elo, $black_avg_elo, $num_elo, $timestamp, $pgn_file_number, $pgn_start_position, @moves) = split / /, $line;