Small refactoring after review.

Reformat BasicSimuilation.
Remove For-Comprehension solution for repeat.