adding feature hierarchy and multi flag query