Added query code.