removing intermediate