First attempt to modify code for KMaps.