Replaced len func with numAtoms, since len does not give num atoms for chains.