new algorithm for matching routes. Syntax for routes changed a bit as well