calculatiing pi with monte carlo method