Now uses poolQuery function