finalizing the topology algorithm...