def METHOD_NAME(pdbin, pdbout, box, nmol, tries):
    """
    Call genbox. (Confirmed working with Gromacs version 4.6.7 and 5.1.4).
    Mainly checks whether genbox ran correctly.
    Parameters
    ----------
    pdbin : str
        Name of input PDB file containing a single molecule.
    pdbout : str
        Name of output PDB file containing solvent box.
    box : float
        Solvent box size, should be determined previously.
    nmol : int
        Number of molecules to go into the solvent box
    tries : int
        Parameter for genbox to try inserting each molecule (tries) times
    Returns
    -------
    None
        If successful, produces "pdbout" containing solvent box.
    """
    if which('gmx'):
        gmxcmd='gmx insert-molecules'
    elif which('genbox'):
        gmxcmd='genbox'
    else:
        raise RuntimeError('gmx and/or genbox not in PATH. Please source Gromacs environment variables.')
    fout=open('genbox.out', 'w')
    ferr=open('genbox.err', 'w')
    subprocess.Popen(f'{gmxcmd} -ci {pdbin} -o genbox.pdb -box {box:.3f} {box:.3f} {box:.3f} -nmol {nmol} -try {tries}',
                     shell=True, stdout=fout, stderr=ferr)
    fout.close()
    ferr.close()
    t0 = time.time()
    print(f"Running {gmxcmd} to create a solvent box...")
    print(f"Time elapsed: {(time.time() - t0): .3f} seconds")
    nmol_out = 0
    for line in open('genbox.err').readlines():
        if 'Output configuration contains' in line:
            nmol_out = int(line.split()[-2])
    if nmol_out == 0:
        raise RuntimeError('genbox failed to produce an output configuration')
    elif nmol_out != nmol:
        raise RuntimeError(f'genbox failed to create a box with {nmol} molecules (actual {nmol_out}); '
                           'please retry with increased box size or number of tries')
    else:
        # genbox throws away the CONECT records in the PDB, this operation adds them back.
        M1 = Molecule(pdbin, build_topology=False)
        M = Molecule('genbox.pdb', build_topology=False)
        solventbox_bonds = []
        # Loop over the number of molecules in the solvent box
        for i in range(nmol):
            for j in M1.bonds:
                # Add the bonds for molecule number "i" in the solvent box
                solventbox_bonds.append((j[0]+i*M1.na, j[1]+i*M1.na))
        M.bonds = solventbox_bonds
        M.write(pdbout)
        print(f"-=# Output #=- Created {pdbout} containing solvent box with {nmol} molecules and length {box:.3f}")