implemented routing function !!!