optimize for many LDH labels when checking for validity
Rename lastNonStable variable