documentation for the pi calculation