Adedd dinamic edges.
Added function generate routes.