An Algorithm For Finding Nearest Neighbors