public static void ChooserOTs(Circuit c, Formatter f, OT ot,
        ObjectOutputStream oos, ObjectInputStream ois)
    {
        Vector<OTTASK> OTs = new Vector<OTTASK>(10, 10);
        IO io = null;

        // Construct vector of all OTs to be executed
        for (int i = 0; i < f.FMT.size(); i++) {
            io = f.FMT.elementAt(i);

            // Only chooser's (= Alice) inputs are interesting here
            if ((!io.isInput()) || (!io.isAlice())) {
                continue;
            }

            // Gather all required OTs in a vector of OTTASKs
            for (int j = 0; j < io.getNLines(); j++) {
                // Get all the params required for making an OTTASK
                int line_num = io.getLinenum(j);
                Gate g = c.getGate(line_num);
                int b = g.getValue();

                // Make an OTTASK and add it to the vector
                OTTASK ottask = new OTTASK(line_num, 2, b);
                OTs.add(ottask);
            }
        }

        // Execute all the required OTs
        ot.executeChooserOTs(OTs, oos, ois);

        // Place results of all OTs in circuit
        for (int i = 0; i < OTs.size(); i++) {
            OTTASK ottask = OTs.elementAt(i);
            Gate g = c.getGate(ottask.ot_id);
            g.setPackedCode(ottask.transferred_value);
        }
    }