constructing cliqued graphs working