Tweaking flags
Splitting the run function into subfunctions.
Adding next and reset buttons.