Optimization and timestep and resizing