count popped states a bit more directly