implementing toy pi approx functions for fun