pmg - add calculation of cpi and spi