added getfacets function