updating latest code for dealing with facets