Add dynamic	routes algorithm