change query to be object oriented comparision