stream-lined check() function