renamed some variables and reverted query exclusion