building basic query parsing