Added debug function 'd'
Worked on routing