Added some comments to try to visualize the simulator's functioning