tweak and improve the discrete event simulation