Internal dt calc. Terminate main loop when out of features(will probably conflict with multirate changes)