Updated code to write the location beacons