Limit on zig zag queries and be able to skip entities that will not match the query

DO NOT MERGE. Requires testing.