Implemented pi calculations