simplifying compute_pi subpatch