Fixed two bugs in the code, including the one stopping longer protein chains (I was using the residue ID instead of the bead type to determine the mass)