Remove inlining, rewrite part of montecarlo_one_packet to be more readable