monte-carlo for pi with pipe