Fix syntax issue in calcRoute function