script to make tree based on citation groups