Rewritte for filtering hoppers. Needs more testing.