Updating merge operations and adding Query functions