add global truncation error and adaptive step size