Finding the nearest marker