Dynamically compute dt, see #3