Changes for new Query stuff and polygon tool