working code to produce full policy graph