Added new parameter 'limit' for findNearest()