A 2D schematic shows how solvateshl works. solvlen equals to the size of one solvate, r1/r2 equals to the van der Waals radius of the solute/solvent atom; extent and closeness are the parameters of this function, closeness represents the closeness between solute and solvent, and extent is used to determine the border of shell. The system will first be covered with a box, and then the box will be stretched to a big one with the length equal to extent. Lots of grids will be generated to represent the centroids of solvents with interval equal to solvlen in the box. For each atom in solvent, distance will be calculated between itself and the atoms in solute and the shortest one will be returned; if it is smaller than dist or longer than extent, the solvent that it belongs to will be excluded from the shell. After checking all the solvents, only a part of them can remain (marked as red), and the others (marked as green) will be neglected.