Map processing algorithm