maybe you could start with empty newqads and copy/expand the original pairs there and then swap newquads for pairs at the end.