refactor, monteCarlo test