modified Nested Queries to include sequences