compiling pebbles and rubbles before replacing