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: #a quick and dirty solution, but works
                      forces[index1].append(f[1]) # push to left (smaller projection value)
                      forces[index2].append(f[0])
                  else:
                      #all is normal
                      forces[index1].append(f[0]) # push to left (smaller projection value)
                      forces[index2].append(f[1])
              else:
                  if self.b_lenght-coeff[index1]<self.b_lenght/10: #a quick and dirty solution, but works
                      forces[index1].append(f[0]) # push to left (smaller projection value)
                      forces[index2].append(f[1])
                  else:
                  #if all is normal
                      forces[index1].append(f[1]) # push to left (smaller projection value)
                      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
docs: Calculates forces between two diagrams and pushes them apart by tenth of width