a better way to test for the absence of elements