uninline code to loops, compact ERRCHECK