Clean code, add docstring, improve simulated_time, nice exit if disabled