added route_cap(routes, brks)

Added route_cap(routes, brks) function.

Also made a helper function that breaks routes into paths.