exercise 7.5 ESTIMATE PI infinite series (cleaned up code)