Integrating planning and improvisation in uncertain domains