def get_bonds(mol):
    """
    Identify the bonds in a molecule
    
    Input:      - mol       OBMol object of the molecule
    
    Outputs:    - atoms     List of atoms in the molecule
                - bonds     List of bonded atoms for each atom in the molecule
    """
    
    # Get molfile of the molecule
    pp = mol.write("mol")
    lines = pp.split("\n")
    
    # Get number of atoms
    n_atoms = len(mol.atoms)
    # Initialize arrays of neighbours
    bonds = [[] for _ in mol.atoms]
    # Initialize array of atoms
    atoms = []
    
    # Parse the atom block
    for l in lines[4:n_atoms + 4]:
        atoms.append(l.split()[3])
    
    # Parse the bond block
    for l in lines[n_atoms + 4:]:
    
        # Detect end of file
        if "END" in l or len(l.split()) != 7:
            break
        
        bond = [int(li)-1 for li in l.split()[:2]]
        
        # Update the list of bonds
        bonds[bond[0]].append(bond[1])
        bonds[bond[1]].append(bond[0])

    return atoms, bonds