Rewrote context query, testing performance