AQ: Implemented hierarchical queries