added adaptive time steps