First draft of simulation implementation

Based on the algorithm from Ronan Reilly