solving pi