Small refactoring after review.

Reformat BasicSimuilation.
Remove For-Comprehension solution for repeat.
Merge pull request #1673 from blemale/feature/new-tutorial

Small refactoring after review.