code: def do_step(self, values, xy_values,coeff, width):
          forces = {k:[] for k,i in enumerate(xy_values)}
          for (index1, value1), (index2,value2) in combinations(enumerate(xy_values),2):
              f = self.calc_2d_forces(value1[0],value1[1],value2[0],value2[1],width)
              if coeff[index1] < coeff[index2]:
                  if self.b_lenght-coeff[index2]<self.b_lenght/10:
                      forces[index1].append(f[1])
                      forces[index2].append(f[0])
                  else:
                      forces[index1].append(f[0])
                      forces[index2].append(f[1])
              else:
                  if self.b_lenght-coeff[index1]<self.b_lenght/10:
                      forces[index1].append(f[0])
                      forces[index2].append(f[1])
                  else:
                      forces[index1].append(f[1])
                      forces[index2].append(f[0])
          forces = {k:sum(v) for k,v in forces.items()}
          energy = sum([abs(x) for x in forces.values()])
          return [(forces[k]/10+v) for k, v in enumerate(values)], energy