private function resolveOrder($routes, $order){
        if (isset($routes[$order])) {
            return $this->resolveOrder($routes, $order + 1);
        } else {
            return $order;
        }
    }