Query changes
Merge code and fix conflicts