public boolean equals(Reaction R){
  
    boolean result = (reactants.length==R.getReactants().length) && 
                     (products.length==R.getProducts().length);
    int i=0;
    boolean finish=false;
    
    while(result && !finish){
      
      if(i<reactants.length){
        
        result = (reactants[i] == R.getReactants()[i]);
        finish=false;
      }
      else{finish=true;}
      
      if(i<products.length){
      
        result &= (products[i] == R.getProducts()[i]);
        finish=false;
      }
      else{finish &= true;}
      
      i++;
      
    }
    
    return result;
    
  }