code: def _find_nn_pos_before_site(self, siteindex):
          
          alldist = [(self._mol.get_distance(siteindex, i), i)
                     for i in range(siteindex)]
          alldist = sorted(alldist, key=lambda x: x[0])
          return [d[1] for d in alldist]
docs: Returns index of nearest neighbor atoms.