def get_box(mol, padding=1.0):
    """
    Given a molecule, find a minimum orthorhombic box containing it.
    Size is calculated using min and max x, y, and z values.
    For best results, call oriented_molecule first.
    
    Args:
        mol: a pymatgen Molecule object
        padding: the extra space to be added in each direction. Double this
            amount will be added to each of the x, y, and z directions

    Returns:
        a list [x1,x2,y1,y2,z1,z2] where x1 is the relative displacement in
        the negative x direction, x2 is the displacement in the positive x
        direction, and so on
    """
    minx, miny, minz, maxx, maxy, maxz = 0.,0.,0.,0.,0.,0.
    for i, p in enumerate(mol):
        x, y, z = p.coords
        if x < minx: minx = x
        if y < minx: minx = y
        if z < minx: minx = z
        if x > maxx: maxx = x
        if y > maxx: maxx = y
        if z > maxx: maxx = z
    return [minx-padding,maxx+padding,miny-padding,maxy+padding,minz-padding,maxz+padding]