monte carlo logic all there, compiles but segmentation fault discovered