Code for collecting dynamic locations.