made PCost more flexible