Note the use of the $!{...} (instead of ${...}) for the name so that nothing is printed if location.name isn't set.
In foreach loops, the velocityCount variable is set to number of the current iteration through the loop.