updateCPTs function written but not tested. It's a knot of list parsing.