Introduced a Monte-Carlo procedure

Cleaned the code a bit by introducing a Monte-Carlo procedure