nmentCount++;
          }

          // Cohesion
          if (d < cohesionRadius) {
            cohesion.x += otherSheep.x;
            cohesion.y += otherSheep.y;
            cohesionCount++;
          }
        }
        //Dog avoidance
        let dogDistance = getDistance(currentSheep.x, currentSheep.y, dogX, dogY);
        if (dogDistance < dogAvoidanceRadius) {
          let diff = { x: currentSheep.x - dogX, y: currentSheep.y - dogY };
          diff.x /= dogDistance;
          diff.y /= dogDistance