 
 	<cfdump var=#d#>
 
+	<cfquery name="dlocid" dbtype="query">
+		select distinct(locality_id) from d
+	</cfquery>
+
 
 	<cfif d.recordcount is 0>
 		No archived information found.<cfabort>

			 from
			 	locality
			 where
			 	locality_id=<cfqueryparam value = "#lid#" CFSQLType = "CF_SQL_INTEGER">
		</cfquery>
		<tr class="datarow" data-lid="#lid#">
			<td class="original">currentData</td>
			<td class="original">-n/a-</td>
			<td class="original">
				<a target="_blank" href="/editLocality.cfm?locality_id=#lid#">
					#orig.LOCALITY_ID#
				</a>
				<br><a target="_blank" href="/SpecimenResults.cfm?locality_id=#lid#">specimens</a>
				<br><a id="m_l_d_#lid#" target="_blank" href="/MediaSearch.cfm?action=search&loc_evt_loc_id=#lid#">media</a>
			</td>
			<cfset lastGeoID=orig.GEOG_AUTH_REC_ID>
			<td class="original">

			<th>WKT-hash</th>
			<th>Remark</th>
		</tr>
	<cfloop query="dlocid">
		<cfquery name="orig" datasource="uam_god">
			select locality_id,
			 	geog_auth_rec_id,
