findinvolvedmolecules.m: complete remake