Some changes in querying, not finished