starting to write my own router to get the concept