Multi threading fixed

Bug was in the random class not being thread-safe