added query and turnstile generator