need to calculate cpsize correctly