implemented an intelligent router