A simple Monte Carlo implementation with unit tests