added graphs and made speed improvements to CPV group calculations