Working router script