Updated simulation logic.