old tweaks to pi implementation