monte carlo compiles and now gives reasonable answers