query system works (I think)
finished merging