pair style that queries "atoms->molecule"

I'd like to write a simple LJ pair style that uses different
parameters depending on whether or not the two atoms belong to the
same molecule. It looks like one could do this by testing for "if
(atoms->molecule[i] == atom->molecule[j])" inside the pair style's
compute() function (I appended some pseudo-code to the end of this
email). Is there any reason this won't work?

Thanks!

---details---

In other words, inside the pair style's compute() function:

firstneigh = list->firstneigh;
for (ii = 0; ii < inum; ii++) {
    i = ilist[ii];
    jlist = firstneigh[i];
    for (jj = 0; jj < jnum; jj++) {
      j = jlist[jj];
      :
      :
      if (atoms->molecule[i] == atom->molecule[j]) {

        compute forces and energies one way

      }
      else {

        compute forces and energies another way

      }
   }
}

yes, atom->molecule[i] is the only
way a processor knows what molecule
the atom is in.

Steve