loops with queries? what was I thinking?