optimized code
query continued
some bug fixes and improvements