updated shell to use certain output file, updated query slightly