Computes pi values for all lengths.
Fixed issue of pi values going to zero