adding correct update_for_pi. using float64 for higher precision