Implemented adaptive time step