Updated query and files