Adding first implementation of findNearestKNodes