Initial query flat implementation