Added query modifications.. Still incomplete