pi calculating function made