anchor.diff:      return false;
     }
     
  -  int factor(int x, int y, bool first)
  -  {
  +  int factor(int currentx, int currenty, int x, int y, bool first, bool breakZigZag)
  +  {
  +    List<int> punto = new List<int>();
  +    punto.add(x);
  +    punto.add(y);
  +    if(breakZigZag == true)
  +    {
  +      return 1;
  +    }
       if(first == true)
       {
  -      this.globalDirectionX = x;
  -      this.globalDirectionY = y;
  +      this.globalDirectionX = abs(currentx);
  +      this.globalDirectionY = abs(currenty);
  +      return 2;
       } else
       {
  -      if(x == this.globalDirectionX && y == this.globalDirectionY)
  +      if(this.enEsquina(punto) == true)
         {
           return 2;
         }
  +      if(abs(currentx) == this.globalDirectionX && abs(currenty) == this.globalDirectionY)
  +      {
  +        return 2;
  +      }
       }
       return 1;
     }
  +  
  +  int abs(int x)
  +  {
  +    if(x<0)
  +    {
  +      return -x;
  +    }
  +    return x;
  +  }
   }
positive.code:     
      if(this.outOfBounds(x+1,y) == false && grid.getElement(x, y) >= grid.getElement(x+1, y)) //abajo
      {
        this.factor(1, 0, first);
        grid.setElement(x, y, max);
        auxList = this.maxDecrecimientosList(grid,x+1,y,false,1,0);
        count.add(auxList[0]+1);
        addedcount.add(auxList[1]+aux*this.factor(direcX, direcY, false));
        grid.setElement(x, y, aux);
        if(grid.getElement(x, y) == grid.getElement(x+1, y))
        {
  
negative.code:     }
      if(this.outOfBounds(x,y-1) == false && grid.getElement(x, y) >= grid.getElement(x, y-1)) //izquierda
      {
        this.factor(0, -1, x, y, first, breakZigZag);
        auxZigZag = (this.factor(0, 1, x, y, false, breakZigZag) == 1);
        grid.setElement(x, y, max);
        auxList = this.maxDecrecimientosList(grid,x,y-1,false,0,-1,auxZigZag);
        count.add(auxList[0]+1);
        addedcount.add(auxList[1]+aux*this.factor(0, 1, x, y, false, breakZigZag));
        grid.setElement(x, y, aux);
        if(grid.getElement(x, y) == grid.getElement(x, y-1))
        {
  