Implement routing. (Ugliest code ever seen)
nit
Missed an important bit