working hash routing and sorting