removed the genquery calls as they are now not needed. also changed a variable name for clarity.