code: private static int exocyclicContribution(int element, int otherElement, int charge, int nCyclic) {
          switch (element) {
              case CARBON:
                  return otherElement != CARBON ? 0 : 1;
              case NITROGEN:
              case PHOSPHORUS:
                  if (charge == 1)
                      return 1;
                  else if (charge == 0 && otherElement == OXYGEN && nCyclic == 1) return 1;
                  return -1;
              case SULPHUR:
                  // quirky but try - O=C1C=CS(=O)C=C1
                  return charge == 0 && otherElement == OXYGEN ? 2 : -1;
          }
          return -1;
      }
docs: Defines the number of electrons contributed when a pi bond is exocyclic
  (spouting). When an atom is connected to an more electronegative atom
  then the electrons are 'pulled' from the ring. The preset conditions are
  as follows:
  
  <ul> <li>A cyclic carbon with an exocyclic pi bond to anything but carbon
  contributes 0 electrons. If the exocyclic atom is also a carbon then 1
  electron is contributed.</li> <li>A cyclic 4 valent nitrogen or
  phosphorus cation with an exocyclic pi bond will always contribute 1
  electron. A 5 valent neutral nitrogen or phosphorus with an exocyclic
  bond to an oxygen contributes 1 electron. </li> <li>A neutral sulphur
  connected to an oxygen contributes 2 electrons</li><li>If none of the
  previous conditions are met the atom is not considered as being able to
  participate in an aromatic system and -1 is returned.</li> </ul>
  
  @param element      the element of the cyclic atom
  @param otherElement the element of the exocyclic atom which is connected
  to the cyclic atom by a pi bond
  @param charge       the charge of the cyclic atom
  @param nCyclic      the number of cyclic pi bonds adjacent to cyclic
  atom
  @return number of contributed electrons