example: pi calculation