working program but still not finished need to check if pi is calculated properly