Monte Carlo code written mainly in C++