script to calculate pi value