Made queries use arraydiff instead of my home grown dodgy solution