add switch logic.
Fix bug in timestamp lookup causing way too fast stepping.