Update nearest.R